package com.example.home.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.home.fragment.HomeFrag
import com.example.home.fragment.PersonalFrag

/**
 * author：jiazhijie
 * date：2025/10/14
 * desc：首页fragment适配器
 * modify record：
 */
class HomeFragViewPageAdapter(fragmentActivity: FragmentActivity) :
    FragmentStateAdapter(fragmentActivity) {

    override fun createFragment(position: Int): Fragment {
        return when(position){
            0 -> HomeFrag.newInstance()
            1 -> PersonalFrag.newInstance()
            else -> HomeFrag.newInstance()
        }

    }

    override fun getItemCount(): Int = 2
}